package cheesymock;

import java.lang.reflect.*;
import net.sf.cglib.proxy.*;

/**
 * {@link Mock} implementation using CGLIB's {@link MethodInterceptor}.
 */
public class CGLIBMock extends Mock implements MethodInterceptor {
	
	public CGLIBMock(Class<?> interfaceToImplement, Validator[] validators, Object delegate, DefaultReturn defaultReturn) {
		super(interfaceToImplement, validators, delegate, defaultReturn);
	}

	public Object intercept(Object obj, Method method, Object[] arguments, MethodProxy proxy) throws Throwable {
		return doInvoke(obj, method, arguments);
	}
}